package com.baitiaojun.tenant.facroty;

import com.alibaba.druid.sql.visitor.functions.If;
import com.baitiaojun.tenant.loader.DataSourceLoader;
import com.baitiaojun.tenant.loader.impl.MySQLDatasourceLoader;

public class DBLoaderFactory {

    private static DataSourceLoader dataSourceLoader = null;

    public static DataSourceLoader getDBLoader(Class<? extends DataSourceLoader> loaderType) {
        if (dataSourceLoader == null) {
            synchronized (DBLoaderFactory.class) {
                if (dataSourceLoader == null) {
                    if (loaderType == MySQLDatasourceLoader.class) {
                        dataSourceLoader = new MySQLDatasourceLoader();
                    }
                }
            }
        }
        return dataSourceLoader;
    }
}
